package com.codinghero.zqlb.spider.servlet;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.sina.sae.fetchurl.SaeFetchurl;

public class FetchUrlServlet extends HttpServlet {

	private static final long serialVersionUID = 1L;
	
	public void doGet(HttpServletRequest req, HttpServletResponse resp)
            throws ServletException, IOException {
		SaeFetchurl fetchUrl = new SaeFetchurl();
		String content = fetchUrl.fetch(req.getParameter("url"));
		System.out.println(content);
		resp.getWriter().print(content);
	}

}
